import Vue from 'vue'
import VueRouter from 'vue-router'

import LoginView from '../views/common-views/login-views/LoginView.vue'
import SignupView from '../views/common-views/login-views/SignupView.vue'
import LicenseView from '../views/common-views/login-views/LicenseView.vue'
Vue.use(VueRouter)


const routes = [
    // 登陆页面
    {
        path: '/',
        name: 'login',
        component: LoginView,
    },

    // 注册页面
    {
        path: '/SignupView',
        name: 'sign',
        component: SignupView,
    },

    // 条款页面
    {
        path: '/LicenseView',
        name: 'license',
        component: LicenseView,
    },

    // 个人页面
    {
        path: '/MyView',
        name: 'myview',
        component: () => import('../views/common-views/my-views/MyView.vue'),
        meta: {
            showNavBar: true,
            active: 4
        }
    },

    // 首页
    {
        path: '/MainView',
        name: 'main',
        component: () => import('../views/common-views/main-views/MainView.vue'),
        meta: {
            showNavBar: true,
            active: 0
        }
    },

    // 地图页面
    {
        path: '/MapView',
        name: 'map',
        component: () => import('../views/common-views/main-views/MapView.vue'),
        meta: {
            showNavBar: true,
            active: 1
        }
    },
    //商品页面
    // 设置页面
    {
        path: '/Shops',
        name: 'shops',
        component: () => import('../views/common-views/main-views/ShopView.vue'),
    },
    {
        path: '/Goods',
        name: 'goods',
        component: () => import('../views/common-views/main-views/ShopGoodsView.vue'),
    },
    {
        path: '/Video',
        name: 'video',
        component: () => import('../views/template-views/VideoPlayer.vue'),
    },

    // 设置页面
    {
        path: '/SettingView',
        name: 'setting',
        component: () => import('../views/common-views/my-views/SettingView.vue'),
    },

    // 地址页面
    {
        path: '/AddressView',
        name: 'address',
        component: () => import('../views/common-views/my-views/AddressView.vue'),
    },

    // 新增地址页面
    {
        path: '/NewAddView',
        name: 'new-address',
        component: () => import('../views/common-views/my-views/NewAddView.vue'),
    },
    {
        path: '/UserView',
        name: 'user',
        component: () => import('../views/common-views/my-views/UserView.vue'),
    },

    // 账号安全页面
    {
        path: '/SecurityView',
        name: 'security',
        component: () => import('../views/common-views/my-views/SecurityView.vue'),
    },

    // 密码修改页面
    {
        path: '/PasswordView',
        name: 'password',
        component: () => import('../views/common-views/my-views/PasswordView.vue'),
    },

    // 账户关联页面
    {
        path: '/ConnectionView',
        name: 'connection',
        component: () => import('../views/common-views/my-views/ConnectionView.vue'),
    },

    // 关于页面
    {
        path: '/AboutView',
        name: 'about',
        component: () => import('../views/common-views/my-views/AboutView.vue'),
    },

    // 宠物页面
    {
        path: '/PetView',
        name: 'PetView',
        component: () => import('../views/template-views/PetView.vue'),
    },

    //评价界面
    {
        path: '/AllReviews',
        name: 'AllReviews',
        component: () => import('../views/template-views/AllReviewsView.vue'),
    },

    // 订单页面
    {
        path: '/OrderView',
        name: 'OrderView',
        component: () => import('../views/template-views/OrderView.vue'),
    },
    // 订单中心
    {
        path: '/OrderCenterView/:active',
        name: 'OrderCenterView',
        component: () => import('../views/common-views/my-views/OrderCenterView.vue'),
    },
    {
        path: '/SearchView',
        name: 'SearchView',
        component: () => import('../views/template-views/SearchView.vue'),
    },
    {
        path: '/MessageView',
        name: 'MessageView',
        component: () => import('../views/common-views/message-views/MessageView.vue'),
        meta: {
            showNavBar: true,
            active: 2
        }
    },
    // 购物车页面
    {
        path: '/CartView',
        name: 'cart',
        component: () => import('../views/common-views/cart-views/CartView.vue'),
        meta: {
            showNavBar: true,
            active: 3
        }
    },
    {
        path: '/MyReviewsView',
        name: 'MyReviewsView',
        component: () => import('../views/common-views/my-views/MyReviewsView.vue'),
    },
    {
        path: '/OrderInfoView',
        name: 'OrderInfoView',
        component: () => import('../views/common-views/my-views/OrderInfoView.vue'),
    },
    {
        path: '/GoReviewView',
        name: 'GoReviewView',
        component: () => import('../views/common-views/my-views/GoReviewView.vue'),
    },
    {
        path: '/RefundView',
        name: 'RefundView',
        component: () => import('../views/common-views/my-views/RefundView.vue'),
    },
    {
        path: '/VIPView',
        name: 'VIPView',
        component: () => import('../views/common-views/my-views/VIPView.vue'),
    },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
